package com.fa.ojcodesandbox.security;

import java.io.FileDescriptor;
import java.security.Permission;

/**
 * ClassName: DefaultSecurityManager
 * Package: com.fa.ojcodesandbox.security
 * Description: 默认安全管理器
 *
 * @Author:
 * @Create: 2024/4/27 - 22:12
 * @Version: v1.0
 */
public class DefaultSecurityManager extends SecurityManager{

    // 检查所有的权限
    @Override
    public void checkPermission(Permission perm) {
        System.out.println("默认不做任何限制");
//        禁用所有的权限
        // super.checkPermission(perm);用于禁用权限
    }

    @Override
    public void checkExec(String cmd) {
        super.checkExec(cmd);
    }

    @Override
    public void checkRead(FileDescriptor fd) {
        super.checkRead(fd);
    }

    @Override
    public void checkWrite(String file) {
        super.checkWrite(file);
    }

    @Override
    public void checkDelete(String file) {
        super.checkDelete(file);
    }

    @Override
    public void checkConnect(String host, int port) {
        super.checkConnect(host, port);
    }
}
